/*
 * @Author: ZhongShiGui 13751817115@163.com
 * @Date: 2023-08-17 18:29:05
 * @LastEditors: ZhongShiGui 13751817115@163.com
 * @LastEditTime: 2023-08-17 18:31:18
 * @FilePath: /cyberwing-web-starter/src/api/modules/workflow/bean/work-todo.ts
 * @Description:工作流待办
 *
 * Copyright (c) 2023 by ZhongShiGui, All Rights Reserved.
 * 2023-08-17 18:29:05
 */

import { OrgServiceApi, WorkflowServiceApi } from "./_workflow";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "@/utils/common";
import service from "@/api";

class WorkFlowServiceApi extends WorkflowServiceApi {
  getPageTodoList(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getPageTodoList";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  pageHistoryTaskInstanceByInstanceId(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/pageHistoryTaskInstanceByInstanceId";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  claim(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/claim";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  unclaim(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/unclaim";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}

export const ExportWorkFlowServiceApi = new WorkFlowServiceApi("/WorkFlowService");

class WorkflowTransferServiceApi extends WorkflowServiceApi {}
export const ExportWorkflowTransferServiceApi = new WorkflowTransferServiceApi("/WorkflowTransferService");
